package com.ruoyi.userManage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.userManage.mapper.TicketConsumeDetailMapper;
import com.ruoyi.userManage.domain.TicketConsumeDetail;
import com.ruoyi.userManage.service.ITicketConsumeDetailService;

/**
 * 漫券消费记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-12
 */
@Service
public class TicketConsumeDetailServiceImpl implements ITicketConsumeDetailService 
{
    @Autowired
    private TicketConsumeDetailMapper ticketConsumeDetailMapper;

    /**
     * 查询漫券消费记录
     * 
     * @param id 漫券消费记录主键
     * @return 漫券消费记录
     */
    @Override
    public TicketConsumeDetail selectTicketConsumeDetailById(Long id)
    {
        return ticketConsumeDetailMapper.selectTicketConsumeDetailById(id);
    }

    /**
     * 查询漫券消费记录列表
     * 
     * @param ticketConsumeDetail 漫券消费记录
     * @return 漫券消费记录
     */
    @Override
    public List<TicketConsumeDetail> selectTicketConsumeDetailList(TicketConsumeDetail ticketConsumeDetail)
    {
        return ticketConsumeDetailMapper.selectTicketConsumeDetailList(ticketConsumeDetail);
    }

    /**
     * 新增漫券消费记录
     * 
     * @param ticketConsumeDetail 漫券消费记录
     * @return 结果
     */
    @Override
    public int insertTicketConsumeDetail(TicketConsumeDetail ticketConsumeDetail)
    {
        ticketConsumeDetail.setCreateTime(DateUtils.getNowDate());
        return ticketConsumeDetailMapper.insertTicketConsumeDetail(ticketConsumeDetail);
    }

    /**
     * 修改漫券消费记录
     * 
     * @param ticketConsumeDetail 漫券消费记录
     * @return 结果
     */
    @Override
    public int updateTicketConsumeDetail(TicketConsumeDetail ticketConsumeDetail)
    {
        ticketConsumeDetail.setUpdateTime(DateUtils.getNowDate());
        return ticketConsumeDetailMapper.updateTicketConsumeDetail(ticketConsumeDetail);
    }

    /**
     * 批量删除漫券消费记录
     * 
     * @param ids 需要删除的漫券消费记录主键
     * @return 结果
     */
    @Override
    public int deleteTicketConsumeDetailByIds(Long[] ids)
    {
        return ticketConsumeDetailMapper.deleteTicketConsumeDetailByIds(ids);
    }

    /**
     * 删除漫券消费记录信息
     * 
     * @param id 漫券消费记录主键
     * @return 结果
     */
    @Override
    public int deleteTicketConsumeDetailById(Long id)
    {
        return ticketConsumeDetailMapper.deleteTicketConsumeDetailById(id);
    }
}
